<script>

    //1、基本语法
    var [a,b,c]=[100,200,300];  //解构数组，将100赋值给a，将200赋值给b，将300赋值给c
    console.log(a,b,c);  //100 200 300

    //2、未赋值
    function foo(){
        return [100,200];
    }

    let [x,y,z]=foo();
    console.log(x,y,z);  //100,200,undefined

    //3、跳跃
    function bar(){
        return [100,200,300,400,500,600];
    }

    let [m,,,n,,k]=bar();
    console.log(m,n,k);  //100 400 600

    //4、解构与rest
    let [u,v,i]=[100,[200,300],{a:400}];
    console.log(u,v,i);

    let [h,[j,l]]=[100,[200,300]];
    console.log(h,j,l);

    let [o,...p]=[1,2,3,4,5]; //结合rest,p收集剩余元素
    console.log(o,p);  //o=1,p=[2,3,4,5]
</script>